home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / STRLWR.C < prev    next >
C/C++ Source or Header  |  1993-04-10  |  2KB  |  73 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       UUPC/extended string lower function                          */
  3. /*                                                                    */
  4. /*       Copyright 1992, Andrew H. Derbyshire                         */
  5. /*                                                                    */
  6. /*       Why this function doesn't exist in GCC is beyond me          */
  7. /*--------------------------------------------------------------------*/
  8.  
  9.  
  10.  
  11. /*--------------------------------------------------------------------*/
  12. /*                          RCS Information                           */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*
  16.  *    $Id: STRLWR.C 1.4 1993/04/11 00:32:05 ahd Exp $
  17.  *
  18.  *    Revision history:
  19.  *    $Log: STRLWR.C $
  20.  *     Revision 1.4  1993/04/11  00:32:05  ahd
  21.  *     Global edits for year, TEXT, etc.
  22.  *
  23.  * Revision 1.3  1992/11/30  03:26:20  ahd
  24.  * Much better if strlwr makes the string LOWER case
  25.  *
  26.  * Revision 1.2  1992/11/19  02:58:39  ahd
  27.  * drop rcsid
  28.  *
  29.  * Revision 1.1  1992/11/16  05:00:26  ahd
  30.  * Initial revision
  31.  *
  32.  */
  33.  
  34.  
  35. /*--------------------------------------------------------------------*/
  36. /*                       Standard include files                       */
  37. /*--------------------------------------------------------------------*/
  38.  
  39. #include <stdio.h>
  40. #include <string.h>
  41. #include <stdlib.h>
  42. #include <ctype.h>
  43.  
  44. /*--------------------------------------------------------------------*/
  45. /*                    UUPC/extended include files                     */
  46. /*--------------------------------------------------------------------*/
  47.  
  48. #include "lib.h"
  49.  
  50. /*--------------------------------------------------------------------*/
  51. /*       s t r l w r                                                  */
  52. /*                                                                    */
  53. /*       Convert a string to lower case                               */
  54. /*--------------------------------------------------------------------*/
  55.  
  56. char *strlwr( char *s )
  57. {
  58.    char *save = s;
  59.  
  60.    if ( s == NULL )
  61.       return s;
  62.  
  63.    while ( *s != '\0' )
  64.    {
  65.       if ( isupper( *s ))
  66.          *s = tolower( *s );
  67.       *s++;
  68.    } /* while */
  69.  
  70.    return save;
  71.  
  72. } /* strlwr */
  73.